﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'PRC_TB_USER_TASK_HISTORY_DE')
	BEGIN
		DROP  Procedure  dbo.PRC_TB_USER_TASK_HISTORY_DE
	END

GO

create procedure [dbo].[PRC_TB_USER_TASK_HISTORY_DE]
(
	@TUH_ID int
)
as

delete tb_user_task_history_change_request_motivation
where TUHM_HISTORY_ID = @TUH_ID

delete TB_USER_TASK_HISTORY
where TUH_ID = @TUH_ID


GO

GRANT EXEC ON dbo.PRC_TB_USER_TASK_HISTORY_DE TO PUBLIC

GO

